package cn.hznc.domain.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @Author：Administrator
 * @Date：2024/1/11 16:57
 */
@Getter
@Setter
@Table(name = "t_log")
@TableName(value = "t_log")
public class LogEntity{

    /**
     * 主键
     */
    @Column(name = "id",type = MySqlTypeConstant.INT,length = 11,isKey = true,isAutoIncrement = true)
    @TableId(type = IdType.AUTO)
    private Integer id;


    /**
     * 标题
     */
    @Column(name = "title",type = MySqlTypeConstant.VARCHAR,length = 300)
    @TableField("title")
    private String title;

    /**
     * 请求方法
     */
    @Column(name = "method",type = MySqlTypeConstant.VARCHAR,length = 300)
    @TableField("method")
    private String method;

    /**
     * 请求方式
     */
    @Column(name = "request_method",type = MySqlTypeConstant.VARCHAR,length = 300)
    @TableField("request_method")
    private String requestMethod;

    /**
     * 操作人姓名
     */
    @Column(name = "operator_name",type = MySqlTypeConstant.VARCHAR,length = 300)
    @TableField("operator_name")
    private String operatorName;

    /**
     * 员工部门
     */
    @Column(name = "employee_dept",type = MySqlTypeConstant.VARCHAR,length = 300)
    @TableField("employee_dept")
    private String employeeDept;

    /**
     * 操作类型
     */
    @Column(name = "operate_type",type = MySqlTypeConstant.TINYINT)
    @TableField("operate_type")
    private Integer operateType;

    /**
     * 操作类型
     */
    @Column(name = "operate",type = MySqlTypeConstant.VARCHAR,length = 300)
    @TableField("operate")
    private String operate;

    /**
     * ip
     */
    @Column(name = "ip",type = MySqlTypeConstant.VARCHAR,length = 300)
    @TableField("ip")
    private String ip;

    /**
     * 请求路径
     */
    @Column(name = "request_url",type = MySqlTypeConstant.VARCHAR,length = 300)
    @TableField("request_url")
    private String requestRul;


    /**
     * 创建时间
     */
    @Column(name = "create_time",type = MySqlTypeConstant.DATETIME)
    @TableField("create_time")
    @JSONField(format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date createTime;
}
